//
//  NewMenuLeftCell.m
//  EducationAdminClient
//
//  Created by 孙添凤 on 16/9/27.
//  Copyright © 2016年 周佳兴. All rights reserved.
//

#import "NewMenuLeftCell.h"
#import "Masonry.h"
#import "UIColor+CL.h"
@implementation NewMenuLeftCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}


-(instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier];
    //    self.selectionStyle = UITableViewCellSelectionStyleNone;
    
    if (self) {
        UIView *view = [self createUI];
        [self.contentView addSubview:view];
        [view mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView.mas_left);
            make.right.equalTo(self.contentView.mas_right);
            make.height.equalTo(self.contentView.mas_height);
            make.bottom.equalTo(self.contentView.mas_bottom);
        }];
        
        
    }
    return self;
}

-(UIView *)createUI{
    UIView *baseView = [[UIView alloc]init];
    baseView.backgroundColor =[UIColor whiteColor];
    
    _img =[[UIImageView alloc]init];
    [baseView addSubview:_img];
    [_img sizeToFit];
    [_img mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(baseView.mas_left).offset(10);
        make.centerY.equalTo(baseView.mas_centerY);
        make.width.equalTo(@(17));
        make.height.equalTo(@(17));
    }];
    _img.image =[UIImage imageNamed:@"f2"];
    
    _menuLabel =[[UILabel alloc]init];
    [baseView addSubview:_menuLabel];
    [_menuLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_img.mas_right).offset(9);
        make.centerY.equalTo(baseView.mas_centerY);
        make.right.equalTo(baseView.mas_right).offset(-6);
    }];
    _menuLabel.text=@"ddd";
    _menuLabel.font =[UIFont systemFontOfSize:16];
    _menuLabel.textColor =[UIColor colorWithHex:0x858585];
    _menuLabel.highlightedTextColor =[UIColor colorWithHex:0xff9c00];
    _menuLabel.numberOfLines = 1;
    _menuLabel.lineBreakMode = NSLineBreakByTruncatingTail;
    
    _LIne =[[UIImageView alloc]init];
    [baseView addSubview:_LIne];
    [_LIne mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(baseView.mas_left);
        make.right.equalTo(baseView.mas_right);
        make.bottom.equalTo(baseView.mas_bottom);
        make.height.equalTo(@(0.5));
    }];
    _LIne.backgroundColor =[UIColor colorWithHex:0xe6e6e6];
    
    return baseView;
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
